#include "CommandArgs.h"

#include <stdexcept>

void CommandArgs::insertArg(const std::string& argType, const boost::any& arg)
{
	m_Args.insert( std::make_pair(argType, arg) );
}

boost::any CommandArgs::getArg(const std::string &argType) const
{
	std::map<std::string, boost::any>::const_iterator it;
	it = m_Args.find(argType);
	if(it == m_Args.end())
	{
		throw std::invalid_argument("Can't find argument");
	}
	return it->second; 
}

void CommandArgs::removeArg(const std::string &argType)
{
	std::map<std::string, boost::any>::const_iterator it;
	it = m_Args.find(argType);
	if(it == m_Args.end())
	{
		throw std::invalid_argument("Can't find argument");
	}
	m_Args.erase(it);
}